package com.cms.recursoshumanos.facade;


import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.handler.WServiceCall;
import com.cms.recursoshumanos.json.me.JSONParser;

public class LostUsernameFacade
{

	private String strEmail;
	
	public LostUsernameFacade(String email)
	{
		this.strEmail = email;
	}
	
	public String enviarSolicitud1()
	{
		 
		JSONParser jParser = new JSONParser();
		return setValores(jParser.
						getJSONFromUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().lostUsername(strEmail)));

	}

	
	public String enviarSolicitud() 
	{
		JSONParser jParser = new JSONParser();
		return jParser.
						setPetitionToUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().lostUsername(strEmail));
		
	}
        
	
	public String setValores(String strResult)
	{
		if (strResult == null || strResult =="")
		{
			return Constant.CODE_NOT_SERVER_RESPONSE;
		}
		else
		{
			return Constant.CODE_OK;
		}
	}
	
}
